package edu.hue.jk.controller;

import edu.hue.jk.entity.User;
import edu.hue.jk.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

/**
 * (User)表控制层
 *
 * @author makejava
 * @since 2022-03-16 15:46:58
 */
@Controller
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("login")
    public String login(@RequestParam("people") int role,@RequestParam("username") String username, @RequestParam("password") String password, Model model){
        return userService.login(role,username,password,model);

    }
    @RequestMapping("/regist")
    public String regist(@RequestParam("register_username") String username,@RequestParam("register_password") String password,Model model){
        return userService.regist(username,password,model);
    }

}